<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景色</title>
    <style>
        div {
            width: 100%;
            height: 500px;
        }
        .dv {
            width: 50%;
            height: 50%;
            /* 红绿蓝三原色，a是透明度 */
            /* background: rgba(red, green, blue, alpha); */
            background: rgba(0, 0, 0, .6);
            text-align: center;
            margin:auto;
        }
    </style>
</head>
<body>
    <div>
        <div class="dv">123</div>
    </div>
</body>
</html>